package com.itheima.reggie.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.reggie.Dto.OrderDTO;
import com.itheima.reggie.common.Result;
import com.itheima.reggie.entity.Orders;

import java.util.Date;

/**
 * @author Yan
 */
public interface OrderService extends IService<Orders> {
    /**
     * 下单
     * @param orders
     * @return
     */
    Result<String> submit(Orders orders);

    /**
     * 最新订单，历史订单
     * @param page
     * @param pageSize
     * @return
     */
    Result<Page<OrderDTO>> findOrderByPage(Long page, Long pageSize);

    /**
     * 后台订单分页查询
     * @param page
     * @param pageSize
     * @param number
     * @param beginTime
     * @param endTime
     * @return
     */
    Result<Page<Orders>> findByPage(Long page, Long pageSize, Long number, Date beginTime, Date endTime);
}